FROM rockylinux

ENV TIMEZONE=Asia/Shanghai \
    LANG=zh_CN.UTF-8

COPY rocky.repo /etc/yum.repos.d/Rocky-BaseOS.repo
COPY docker-ce.repo /etc/yum.repos.d/docker-ce.repo
RUN mkdir -p /usr/share/jenkins \
    && mkdir -p /root/.kube \
    && yum clean all \
    && yum makecache \
	&& yum install -y java-17-openjdk \   
	&& yum install -y docker-ce \
	&& yum install -y git \
	&& yum install -y python2 \
	&& yum install -y make \
	&& yum install -y gcc-c++ \
    && yum clean all
ADD node-v14.9.0-linux-x64.tar.gz /opt
RUN ln -s /opt/node-v14.9.0-linux-x64/bin/node /usr/local/bin/node \
    && ln -s /opt/node-v14.9.0-linux-x64/bin/npm /usr/local/bin/npm \
	&& ln -s /opt/node-v14.9.0-linux-x64/bin/npx /usr/local/bin/npx
COPY jenkins-slave /usr/local/bin/jenkins-slave
COPY slave.jar /usr/share/jenkins
COPY kubectl /usr/bin/kubectl


USER root

WORKDIR /home/jenkins

ENTRYPOINT ["jenkins-slave"]
